package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.List;

import com.xcity.game.map.template.MineTypeTemplate;

import naga.x.App;
import naga.x.game.template.TemplateService;
import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class MineOpenResponse extends Response {
	private List<Long> list;
	
	private List<MineTypeInfo> typeList;
	
	public static class MineTypeInfo{
		public int type;
		public String name;
		public String img;
		public String anim;
		public MineTypeInfo(MineTypeTemplate temp){
			type = temp.getId();
			name = temp.getName();
			img = temp.getImg();
			anim = temp.getAnim();
		}
	}
	
	public MineOpenResponse(int serial, List<Long> list) {
		super(serial);
		this.list = list;
		typeList = new ArrayList<MineTypeInfo>();
		List<MineTypeTemplate> tempList = App.getApp().getServiceManager().get(TemplateService.class).getTemplatesList(MineTypeTemplate.class);
		for(int i = 0; i < tempList.size(); i++){
			MineTypeInfo info = new MineTypeInfo(tempList.get(i));
			typeList.add(info);			
		}
	}
	public List<Long> getList() {
		return list;
	}
	public void setList(List<Long> list) {
		this.list = list;
	}
	public List<MineTypeInfo> getTypeList() {
		return typeList;
	}
	public void setTypeList(List<MineTypeInfo> typeList) {
		this.typeList = typeList;
	}
}
